<html>
<head><meta charset="utf-8"><title>-Zbuild-std on custom toolchain · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html">-Zbuild-std on custom toolchain</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204449305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204449305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Izzy Swart <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204449305">(Jul 20 2020 at 17:14)</a>:</h4>
<p>Sorry if this isn't the right place to ask this, there's no #t-cargo/help as far as I can tell. Is it possible to use <code>-Zbuild-std</code> with a custom toolchain (a la the functionality the <code>RUST_XARGO_SRC</code> env var provides with xargo)? I can't install the <code>rust-src</code> component using <code>rustup</code> and the feature doc in the Unstable Features gitbook states that doing so is necessary, but I just want to make sure I'm not missing something, I'd prefer to switch away from xargo.</p>



<a name="204452879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204452879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204452879">(Jul 20 2020 at 17:46)</a>:</h4>
<p>There isn't any way to explicitly set a custom source. You can symlink the <code>src</code> directory in the sysroot if you want to hack a solution.</p>



<a name="204455576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204455576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Izzy Swart <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204455576">(Jul 20 2020 at 18:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120518">Eric Huss</span> <a href="#narrow/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain/near/204452879">said</a>:</p>
<blockquote>
<p>There isn't any way to explicitly set a custom source. You can symlink the <code>src</code> directory in the sysroot if you want to hack a solution.</p>
</blockquote>
<p>Thanks, it actually looks like <code>rustup toolchain link</code> does that by default and I just screwed the symlink up by moving my build directory.</p>



<a name="204639385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204639385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204639385">(Jul 22 2020 at 08:05)</a>:</h4>
<p><span class="user-mention" data-user-id="266752">@Izzy Swart</span> heh. btw <code>rustup toolchain link</code> mostly only creates one symlink, so presumably the <code>src</code> symlink that got broken is the one inside the build directory</p>



<a name="204639469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204639469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204639469">(Jul 22 2020 at 08:06)</a>:</h4>
<p>oh I guess by default you wouldn't see the effects of that if you ran tests, I was gonna give an example of something else affected but I guess I don't have any</p>



<a name="204639593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204639593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204639593">(Jul 22 2020 at 08:08)</a>:</h4>
<p>(I think the main reason I added that symlink was for diagnostics which refer to core/std sources, if there's a certain <code>config.toml</code> option set some tests just wouldn't pass without core/std being available through the sysroot)</p>



<a name="204639617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204639617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204639617">(Jul 22 2020 at 08:08)</a>:</h4>
<p><span class="user-mention" data-user-id="266752">@Izzy Swart</span> oh and I guess for e.g. <code>bin/rustc</code> and pretty much any other file we use hard links which is why not everything instantly breaks when you move that directory</p>



<a name="204639718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/-Zbuild-std%20on%20custom%20toolchain/near/204639718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/-Zbuild-std.20on.20custom.20toolchain.html#204639718">(Jul 22 2020 at 08:10)</a>:</h4>
<p>/me wonders if we should avoid using absolute paths as much as possible but that's really getting into weeds</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>